/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.CompleteActions;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.BasicActions.InputPin;
import edu.pku.sei.modeler.model.uml.Kernel.Classifier;
import edu.pku.sei.modeler.model.uml.BasicActions.OutputPin;

import edu.pku.sei.modeler.model.uml.FundamentalActivities.Action;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class UnmarshallAction extends Action implements IUnmarshallAction {
	// attributes
	
	protected InputPin object;
	
	protected Classifier unmarshallType;
	
	
	
	
	// references
	
	protected MetaTypedList result;
	
	
	
	// getters & setters for attributes
	
	public InputPin getObject() {
		return object;
	}
	public void setObject(InputPin newObject) {
		InputPin oldobject = object;
		object = newObject;
		firePropertyChange(ModelPackage.UNMARSHALLACTION_OBJECT, oldobject, newObject);
	}
	
	public Classifier getUnmarshallType() {
		return unmarshallType;
	}
	public void setUnmarshallType(Classifier newUnmarshallType) {
		Classifier oldunmarshallType = unmarshallType;
		unmarshallType = newUnmarshallType;
		firePropertyChange(ModelPackage.UNMARSHALLACTION_UNMARSHALLTYPE, oldunmarshallType, newUnmarshallType);
	}
	
	// getters for references
	
	public MetaTypedList getResult() {
		if(result == null) {
			result = new MetaTypedList(OutputPin.class, this, ModelPackage.UNMARSHALLACTION_RESULT);
		}
		return result;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeNode(root, ModelPackage.UNMARSHALLACTION_OBJECT, object);
		
		XMLUtility.xmlInstance.serializeNode(root, ModelPackage.UNMARSHALLACTION_UNMARSHALLTYPE, unmarshallType);
		
		// references
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.UNMARSHALLACTION_RESULT, result);		
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		object = (InputPin)XMLUtility.xmlInstance.deSerializeNode(root, ModelPackage.UNMARSHALLACTION_OBJECT, this);
		
		unmarshallType = (Classifier)XMLUtility.xmlInstance.deSerializeNode(root, ModelPackage.UNMARSHALLACTION_UNMARSHALLTYPE, this);
		
		// references
		
		this.getResult().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.UNMARSHALLACTION_RESULT, this));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		else if(ModelPackage.UNMARSHALLACTION_OBJECT.equals(featureID)) {
			object = (InputPin)value;
		}
		
		else if(ModelPackage.UNMARSHALLACTION_UNMARSHALLTYPE.equals(featureID)) {
			unmarshallType = (Classifier)value;
		}
		
		// references
		
		else if(ModelPackage.UNMARSHALLACTION_RESULT.equals(featureID)) {
			getResult().add(value);
		}
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 